import React from 'react';
import { Form, Row, DatePicker, Button, Select, Input, Col, Radio, Card } from 'antd';
const FormItem = Form.Item;
const { Option } = Select;
const { RangePicker } = DatePicker

const ResultForm = ({ form: { getFieldDecorator, getFieldsValue }, isEdit, searchItem, titleStyle, title }) => {

  return (
    <Card title={<div style={titleStyle}>{title}</div>} bordered={false}>
      <Form layout='vertical'>
        <Row gutter={16}>
          <Col span={8}>
            <FormItem label="装配员">
              {getFieldDecorator('checkItemCode', {
                initialValue: searchItem.checkItemCode
              })(
                <Input placeholder='请选择装配员' allowClear disabled={!isEdit} />
              )}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem label="装配员填写日期">
              {getFieldDecorator('checkItemName', {
                initialValue: searchItem.checkItemName || ''
              })(
                <DatePicker placeholder='填写日期' style={{ width: '100%' }} disabled={!isEdit} />
              )}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem label="装配组长">
              {getFieldDecorator('checkTypeSecond', {
                initialValue: searchItem.checkTypeSecond || ''
              })(
                <Input placeholder='请输入装配组长' allowClear disabled={!isEdit} />
              )}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem label="组长确认日期">
              {getFieldDecorator('checkItemName', {
                initialValue: searchItem.checkItemName || ''
              })(
                <DatePicker placeholder='确认日期' style={{ width: '100%' }} disabled={!isEdit} />
              )}
            </FormItem>
          </Col>
          <Col span={8}>
            <FormItem label="结论">
              {getFieldDecorator('checkTypeSecond', {
                initialValue: searchItem.checkTypeSecond || ''
              })(
                <Input placeholder='请输入结论' allowClear disabled={!isEdit} />
              )}
            </FormItem>
          </Col>
        </Row>
      </Form>
    </Card>
  );
};

export default Form.create()(ResultForm);
